Method of secure memory addressing

ABSTRACT

The problem to be solved is to seek an alternative to known addressing methods which provides the same or similar effects or is more secure. Solution The problem is solved by a method (40) of addressing memory in a data-processing apparatus (10) comprising, when a central processing unit (11), while performing a task (31, 32, 33, 34) of the apparatus (10), executes an instruction involving a pointer (59) into a segment (s, r, d, h, f, o, i, c) of the memory: decoding the instruction by means of an instruction decoder (12), generating a virtual address (45) within the memory by means of a safe pointer operator (41) operating on the pointer (59), augmenting the virtual address (45) by an identifier (43) of the task (31, 32, 33, 34) and an identifier (44) of the segment (s, r, d, h, f, o, i, c), said identifiers (43, 44) being hardware-controlled (42), and, based on the augmented address (45), dereferencing the pointer (59) via a memory management unit (13).

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No. 16/079,667, filed on Aug. 24, 2018, hereby incorporated by reference, which is a national stage entry of Patent Cooperation Treaty Application No. PCT/EP2017/054535, filed on Feb. 27, 2017, which is a continuation of Patent Cooperation Treaty Application No. PCT/EP2016/000344, filed on Feb. 27, 2016 and a continuation of PCT/EP2016/000345, filed on Feb. 27, 2016.

TECHNICAL FIELD

The invention relates to a method of memory addressing as well as a corresponding data-processing apparatus, computer program, data carrier, and data structure.

BACKGROUND ART

In the context of security technology and information governance, by information security is meant the practice of preventing unauthorized access, use, disclosure, disruption, modification, inspection, recording or destruction of information. Information security of data-processing apparatuses is termed cybersecurity, computer security, or IT security. State-of-the-art cybersecurity encompasses control of physical or network access to data-processing apparatuses as well as protection from disruption or misdirection of the services they provide, data manipulation, and code injection.

As an example of the latter class of attacks, FIG. 1 illustrates the possible exploitation of a software defect in an insecure prior-art data-processing apparatus (10) graphically represented by its technology stack. As per the traditional von Neumann architecture for electronic digital computers, the prior-art apparatus (10) takes the form of a stored-program computer, that is, a computer based on a central processing unit (11) whose program instructions, as well as data, are kept in one single, uniform, read-write, random-access memory (RAM) devoid of specific security precautions.

This property is reflected in the processor's instruction set architecture (ISA), which is predominantly embodied in its instruction decoder (12). While FIG. 1 depicts the instruction decoder (12) as a separate functional block atop the central processing unit (11), the former is in fact integrated within the latter rather than implemented as discrete circuitry. Interfacing to said hardware (11, 12) is the low-level software (13) constituted by drivers and further elements—such as a basic input-output system (BIOS) in case of a personal computer (PC)—as well as profound layers of the operating system (OS) which, among other tasks, configures the hardware's memory management unit (MMU) and provides task management and process scheduling capabilities.

Said hardware and basic OS functionality (11, 12, 13) constitute the foundation for any software adapted to the data-processing apparatus (10), such software typically comprising multiple layers (14) of middleware that culminate in the actual application (15). Where the software is faulty in any of said layers, an attacker—in what is known as a cyber-attack (17)—may leverage this vulnerability and cause the data-processing apparatus (10) to crash. Even more severely, to seize control of the apparatus (10), an exploit of the vulnerability could enable the attacker to maliciously bypass (18) all lower software layers of the technology stack in order to directly access the instruction decoder (12), thereby usurping unrestricted power over all resources offered by the insecure “bare-metal” hardware system (11, 12). To this end, once having breached the designated flow of control, the attacker may redirect it to machine instructions of his choosing that have been injected into or selected from memory by a technique referred to as return-oriented programming (ROP). Once such “malware” is fed to the instruction decoder (12), the data-processing apparatus (10) may exhibit unintended or unanticipated behavior, and may even become completely controlled by the attacker.

Conventional approaches to detecting or preventing code injections include marking of memory areas to the apparatus as non-executable. Another countermeasure particularly suited for buffer overflow attacks is known in the art as “stack canaries”. Return address overwrites such as seen during exploitation of stack buffer overflows may further be mitigated by so-called shadow stacks. These and other techniques are employed by the artisan to maintain control-flow integrity (CFI), that is, prevent malware attacks from redirecting or hi-jacking the flow of execution of a program.

SUMMARY OF INVENTION

The invention as claimed is hereinafter disclosed in such a way that the technical problem with which it deals can be appreciated and the solution can be understood.

Technical Problem

The problem to be solved is to seek an alternative to known concepts which provides the same or similar effects or is more secure.

Solution to Problem

To elucidate the nature of the solution, reference is made to the characterizing portion of the independent claims.

Advantageous Effect of Invention

The invention gives rise to efficient data processing, efficient data storage, and enhanced security.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a data-processing apparatus in accordance with the prior art.

FIG. 2 shows a data-processing apparatus as per the invention.

FIG. 3 shows a data structure used in the apparatus.

FIG. 4 shows a method of addressing memory in the apparatus.

FIG. 5 shows pointer and descriptor words used in the method.

FIG. 6 shows a data word used in the method; and

FIG. 7 shows a type word used in the method.

DESCRIPTION OF EMBODIMENTS

Referring to FIG. 2, the invention mitigates the impact of a cyber-attack (17) by introduction of what may be considered a cybersecure ISA. By virtually swapping, in terms of their levels within the technology stack, the instruction decoder (12) for the task, process, and memory management layer, this layer (13) and the instruction decoder (12) are arranged such that the latter isolates the former from direct access by potentially malicious software, all while leaving the higher parts of the technology stack intact. In a preferred embodiment, recognizing the indispensability of task separation for the design of a fully secure apparatus (10), the scheduler is even at least partly implemented in hardware and said part—being in charge of all process switching activities of the scheduler—directly wired to the memory management unit (MMU).

Where the data-processing apparatus (10) takes the form of a concurrent system, this approach allows for a virtual memory layout (30) as exemplified in FIG. 3. The structure (30) shown is laid out in a two-dimensional grid comprising at least one row and at least one column of mutually disjunct virtual memory spaces “mem s1”, “mem s2”, and so forth, each of which not only being uniquely associated with one among the tasks (31, 32, 33, 34)—as is state-of-the-art in contemporary virtual memory management designs—but additionally also being uniquely associated with one of the memory segments (s, r, d, h, f, o, i, c). Therefore, each single memory cell of the overall memory structure (30) is uniquely identified by its row number (segment), its column number (task), and its local virtual address (45) within the selected virtual memory subspace, any unique combination of said three identifiers constituting a composite augmented virtual address or hyperaddress, for short. In an alternative embodiment that extends upon this concept, any column associated with a multi-threaded task would split into multiple columns, each being associated with an execution thread of the respective task (31, 32, 33, 34) and effectively rendering the grid three-dimensional. When hereinafter reference is made to a task (31, 32, 33, 34), such a task may be understood to comprise any number of threads, the generalizations necessary for multi-threaded task processing being regarded as obvious and part of the scope of the invention.

Vertically, the grid of the present example comprises eight rows, each row being uniquely associated with a memory segment. For any among the tasks (31, 32, 33, 34), one such segment remains hidden to and inaccessible for the software itself, and contains a stack exclusively dedicated to subroutine return addresses and controlled by hardware. Especially in a stack machine, that task (31, 32, 33, 34) may also entail a segment (r) containing a working stack that stores subroutine contexts, call, return, and local variables, and intermediate computational results. A segment (d) containing an ancillary data stack is optional. Finally, the task (31, 32, 33, 34) could possess any number of heap (h), file (f), write-only channel output (o), or read-only channel input (i) segments as needed.

A mandatory code (c) segment, hidden and inaccessible by the software itself, serves as read-only input to the instruction decoder (12), otherwise being protected from reading and writing. This feature may be considered an implementation of the Harvard computer architecture as it imposes distinct code and data address spaces, rendering the memory layout (30) invulnerable to code injection.

Attention is now directed to FIG. 4, which highlights the address resolution per the proposed ISA. When the central processing unit (11), while performing one of the tasks (31, 32, 33, 34), executes an instruction involving a pointer into one of the memory segments (s, r, d, h, f, o, i, c), it decodes the instruction by means of the instruction decoder (12), as would in and of itself be expected in a conventional system. Characteristically of this embodiment however, the instruction decoder (12) now generates a local virtual address (45) by means of a safe pointer operator (41) that is preferably implemented in hardware. The ISA defines a pointer instruction subset specifically dedicated to this purpose.

Once generated, the local virtual address (45) is augmented, such as through concatenation, by an identifier (43) of the task (31, 32, 33, 34) and an identifier (44) of the memory segment (s, r, d, h, f, o, i, c), both identifiers being essentially hardware-controlled (42), identifier (43) by the scheduler, and identifier (44) by the safe pointer operator (41). Based on this composite augmented virtual address—hyperaddress—(46), the pointer may finally be dereferenced via the memory management unit (MMU) and its data accessed safely and securely. By design, each task (31, 32, 33, 34) thus benefits from its own data privacy sphere as well as full memory access integrity and control flow integrity and hence resides in what in the art is known as a “trust zone” that is maintained by a per-task virtual processing scheme (as opposed to known coarser—and more vulnerable—two-virtual-processor schemes).

In a preferred embodiment explained regarding FIG. 5, the apparatus (10) takes the form of a stack machine, wherein pointers are always kept on a protected working stack in memory segment (r) and never in unprotected memory or file (d, h, f, o, i). As more fully exemplified in FIG. 7, information (56) of FIG. 5 comprises a part or segment (e.g., 12 bits wide) of a typed data word (50) or (58) which contains binary data type information (51) and a remaining part or segment (57) that holds the binary raw data content of the typed data word (50). In this scenario, the central processing unit (11), when executing the instruction, extracts the pointer's (59) target information (52, 53, 54) from the typed data word (50) on the working stack in memory segment (r). The typed data word (50) comprises information (51) regarding the pointer's (59) own data type—to be evaluated by the safe pointer operator (41)—and protection status—to be checked by the instruction decoder (12)—and further information necessary for the low-level operating system layer (LLOS) (13) e. g. to safeguard memory accesses from hazards like “dangling pointers” or to organize inter-task channel communications. The pointer's (59) target data field comprises a target data type word (52) indicating the type of the data it references (either data by value or a further pointer) as well as a handle (53) referring to a block of virtual memory allocated and assigned to the pointer (59) within its target segment (s, r, d, h, f, o, i, c) and an index (54) referring, within said virtual memory block, to the final virtual memory location of that data record which holds the binary data word referenced by the pointer (59). Of these components, only the index (54) information can be loaded into or retrieved from the pointer (59) by software. This capability proves useful for structures that contain pointer values, as may be used in C or similar programming languages.

The eminent benefit of the type word (52) is best gathered from FIG. 6 where that word is employed to assemble what could be called a typed data word (60): Upon dereferencing the pointer (59) by loading the “raw”, that is type-less, data word (61)—via the memory management unit—from RAM or any other memory location onto the stack, the result is complemented with the type word (52), which can simply be copied from the pointer (59) that referenced it. The binary data loaded to the stack is now complete with information on how to handle and interpret it. Hence, metaphorically speaking, the pointer (59) “knows” the data type it references.

Since type information is henceforth contained in a segment (r) containing data space as opposed to a segment (c) containing code space, CPU execution may be guided by type, reducing the required instruction set to a minimum. The resulting ability to use universal standard code for all—even vector or otherwise special—data types confers extreme flexibility to the data processing apparatus (10). In programming languages and type theory, such provision of a single interface to entities of different types is known as polymorphism.

FIG. 7 demonstrates how even a compact 12-bit type word (52) may convey an abundance of type information. For instance, in the draft depicted, bits 10 and 11 of the type word (52) indicate whether the ensuing data word (61) contains binary data by value or a pointer (59) to either data or some other pointer. This type information is respected by all instructions of the data processing apparatus (10) which in a preferred embodiment are designed to either target data words (“data instructions”) or pointer words (“pointer instructions”) and which, when applied to the “wrong” type of word, raise an exception. By this device, numerical data held on the working stack contained in memory segment (r) is protected from being mistaken as a pointer and pointers are protected from being overwritten or tampered with by operations not specifically designed for this purpose within the instruction set architecture (ISA), the operating system task (OS) being an exception of this generic safety-of-operation rule. Where that pointer (59) represents a range of addresses within memory rather than a fixed address, bits 10 and 11 would also designate whether the pointer (59) have read/write or read only or write only permissions, the latter two options offering hardware support for e. g. ring buffers for inter-task channel communication via hardware-coupled—and hence functionally safe—write and read pointer pairs. A subsequent descriptor word (58) on the stack may arithmetically describe the address range itself in terms of certain structural properties—e. g., linear as in an array or cyclic as in a ring buffer—, specify an incremental stride to be used when advancing the pointer (59) throughout the range, the size of the range, or its base address (55). Herein, stride and size should preferably be expressed as multiples of the width of the respective data, that is, the size of the record holding them. Note that these parameters, when considered in their entirety, implicitly define the boundaries of the represented address range. Based on this knowledge, the hardware may practically guarantee functional safety of all pointer accesses including protection from unauthorized reading or overwriting. In the context of abstract data types, the outlined concept would commonly be referred to as a smart pointer.

In the draft at hand, bit 9 of the type word (52) marks the—contained or referencing—data as being either of an elementary or composite, further structured type. In the former case, the type word (52) may also provide guidance on aspects like the following:

-   -   the width of the data expressed in a unit of raw information         such as bits (bits 6, 7, 8),     -   whether the data constitutes a vector unit or sub-unit of         multiple data points (bit 5) preferably to be processed with a         parallel single SIMD instruction of the central processing unit         (11),     -   whether the data type is standard or a—preferably         nullable—interval type (bit 4),     -   whether the data is a floating-point or an unsigned or signed         integer number or otherwise special—such as a character, index         of a pointer, function pointer, semaphore or inter-task         communication channel—(bits 2, 3),     -   whether the data has been loaded from a buffer or cache memory         into the stack—and hence is valid—or such load is pending         (“lazy” loading bit 1), and     -   whether the data has been newly added to or changed on the stack         since last loaded from buffer or cache memory—and hence is         out-of-sync with said buffer or cache memory (“dirty” bit 0).

INDUSTRIAL APPLICABILITY

The invention may be applied, inter alia, throughout the semiconductor industry. 

1. A method (40) of addressing memory in a data-processing apparatus (10) comprising a central processing unit (11), the central processing unit performing a task (31, 32, 33, 34) of the apparatus (10), the task (31, 32, 33, 34) of the apparatus comprising executing an instruction involving a a virtual memory address (45) located in a segment (s, r, d, h, f, o, i, c) of the memory, the method comprising: decoding the instruction by means of an instruction decoder (12), augmenting the virtual memory address (45) by an identifier (43) of the task (31, 32, 33, 34) or an identifier (44) of the segment (s, r, d, h, f, o, i, c), or both identifiers (43, 44), said identifier or identifiers being hardware-controlled (42), and translating the augmented address (46) by a memory management unit (MMU) to a corresponding physical address.
 2. The method (40) of claim 1, further comprising the step of generating the virtual memory address by executing an instruction involving a pointer (59) to a segment (s, r, d, h, f, o, i, c) of the memory.
 3. The method (40) of claim 2, further comprising: dereferencing the pointer (59) for a data load by assembling a typed data word (60), wherein the typed data word (60) comprises a data word (61) and a type word (52), the data word (61) comprising loaded binary raw data, wherein the type word (52) is part of and copied from the pointer (59) and indicates an abstract data type (ADT) associated to the loaded binary raw data, thereby declaring the ADT of the assembled typed data word (60); and processing the typed data word (60) based on the type word (52).
 4. The method (40) of claim 3 wherein the data word (61) is referenced by means of a handle (53) referring to a memory block allocated to the pointer (59) within one of the segments (s, r, d, h, f, o, i, c) or within unsegmented memory and an index (54) referring, within the memory block, to a data record holding the data word (61).
 5. The method (40) of claim 3, wherein the type word (52) of the typed data word (60) indicates whether the data word (61) contains data by value, a pointer (59), or a descriptor belonging to a pointer, and the type word (52) further indicates whether the data word (61) is of an elementary type or a composite type, and the pointer (59) references either data by value or a further pointer.
 6. The method (40) of claim 5, wherein the type word (52) indicates that the type is an elementary data word and also indicates any or all of the following: a width of the data expressed in a unit of information, whether the data constitutes a vector of multiple data points preferably to be processed with a single instruction of the central processing unit (11), whether the data is of a standard or an interval type, whether the data is of a numeric type, or is a character, a string, user-defined, or otherwise special, whether the data has been loaded from a buffer or cache memory or such a load is pending, whether the data has been added to or changed since last its last load from buffer or cache memory.
 7. The method (40) of claim 5, wherein if the type word (52) indicates that the data word (61) contains a pointer (59) and specifies which of the segments (s, r, d, h, f, o, I, c) the pointer points to, and the pointer (59) is a smart pointer.
 8. The method (40) of claim 5 wherein, the type word (52) further indicates that the type is a descriptor belonging to a pointer, and the data word (61) contains a descriptor (55) which describes any or all of the following: an arithmetic type of the pointer (59) selected from linear (“array pointer”), cyclic (“ring buffer pointer”), and arithmeticless (“fixed pointer”), a stride, expressed as a multiple of the width of the data to which the pointer points to, expressed as a unit of information, a base address and a size of the range allowed for access by the pointer (59).
 9. A data-processing apparatus (10) having memory, a central processing unit (11), an instruction decoder (12), a low-level operating system (LLOS) layer comprising at least task, process, and memory management facilities and implemented in software, in hardware, or in a combination of both (13), wherein the data processing apparatus is adapted to execute the steps of the method (40) of claim
 1. 10. The data-processing apparatus (10) of claim 9, wherein the instruction decoder (12) and the LLOS layer (13) are arranged such that the instruction decoder (12) entirely isolates the LLOS layer (13) from any direct software access.
 11. The data-processing apparatus (10) of claim 10, wherein the software comprises: multiple layers (14); and an application (15) based upon the layers (14).
 12. A computer readable medium having instructions stored thereon, wherein when executed by a processor, the instructions execute the steps of the method (40) of claim
 1. 13. A data processing apparatus (10) configured to perform the method (40) of claim 1 thereby implementing a virtual memory layout and structure (30) and providing the augmented virtual address (46) to the memory management unit (MMU) of the data processing apparatus (10), the structure (30) having an at least two-dimensional grid layout of columns and rows of virtual memory address spaces.
 14. The data processing apparatus (10) of claim 13 wherein, in the virtual memory layout and structure (30), for each task (31, 32, 33, 34) among the tasks (31, 32, 33, 34), the column associated with that task (31, 32, 33, 34) comprises multiple levels, each being associated with an execution thread of the respective task (31, 32, 33, 34) and accordingly, the task identifier prefix (43) of the augmented virtual address (46) constructed by method (40) comprises additional information regarding the identifier of the executing thread.
 15. The method of claim 2, wherein the step of generating the virtual memory address (45) within the memory of said task is performed by means of a safe pointer operator (41) operating on the pointer (59).
 16. The method of claim 2, wherein the pointer (59) is located in protected memory.
 17. The method of claim 16, wherein the protected memory comprises a working stack, and the pointer (59) is contained in the working stack. 